<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增辅料出入库明细')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-detail-add" th:object="${partIngredients}">
            <input name="partId" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label ">辅料名称：</label>
                <div class="col-sm-8">
                    <input disabled="disabled" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">子名称：</label>
                <div class="col-sm-8">
                    <input disabled="disabled" th:field="*{subName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">库存数量：</label>
                <div class="col-sm-8">
                    <input disabled="disabled"  th:field="*{inventory}" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">出库数量：</label>
                <div class="col-sm-8">
                    <input name="changeValue" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">领取时间：</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control time-input" id="startTime" placeholder="领取时间"
                           name="receiveTimr" data-format="yyyy-MM-dd"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">领取人：</label>
                <div class="col-sm-8">
                    <select name="receiver" id="receiver" class="form-control" required>
                        <option value="">无</option>
                        <option th:each="user : ${users}" th:text="${user.userName}" th:value="${user.userName}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/detail";
        $("#form-detail-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            var val = $("#receiver").val();
            if(val==null || val==""){
                layer.alert("请选择领取人");
                return false;
            }
            if ($.validate.form()) {
                $.operate.save(prefix + "/outStore", $('#form-detail-add').serialize());
            }
        }
    </script>
</body>
</html>